<template>
  <base-panel>
    <top-simple-search @searchFun="getList" @addFun="toAdd">
    </top-simple-search>
    <simple-table ref="myTable" size="mini">
      <el-table-column label="字典名称" align="center" prop="name" :show-overflow-tooltip="true" />
      <el-table-column label="字典编号" align="center" :show-overflow-tooltip="true">
        <template slot-scope="{row}">
          <my-link @to="showList(row)">
            {{row.value }}
          </my-link>
        </template>
      </el-table-column>
      <my-dict-column label="状态" align="center" prop="status" dist-key="button_status_bool"></my-dict-column>
      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
      <my-time-column label="创建时间" align="center" prop="gmt_created" width="180"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220" fixed="right">
        <template slot-scope="{row}">
          <detail-button @click="toDetail(row)"></detail-button>
          <edit-button @click="toEdit(row)"></edit-button>
          <delete-button @click="toDelete(row.id)"></delete-button>
          <detail-button @click="showList(row)">字典配置</detail-button>
        </template>
      </el-table-column>
    </simple-table>
    <detail-dialog v-if="visible" :visible.sync="visible" :row="currRow" @reloadList="getList" :disabled="disabled"></detail-dialog>
  </base-panel>
</template>
<script>
  import simpleTable from '@/mixins/SimpleTable'
  import DetailDialog from './DetailDialog'
  import MyTimeColumn from '@/components/TableColumn/MyTimeColumn'
  import MySwitchColumn from '../../../components/TableColumn/MySwitchColumn'
  import MyDictColumn from '../../../components/TableColumn/MyDictColumn'
  import MyLink from '../../../components/MyLink/index'
  // 获取登录用户信息
  export default {
    name:"userTable",
    components: { MyLink, MyDictColumn, MySwitchColumn, MyTimeColumn, DetailDialog },
    mixins: [simpleTable],
    data() {
      return {
        roleUsersVisible: false,
        roleVisible:false
      }
    },
    created() {
      this.getDicts("button_status_bool").then(response => {
        this.statusOptions = response.data;
      });
    },
    methods: {
      showList(row){
        this.$router.push("/systemManagement/dictData?id="+row.id+"&title="+row.name)
      },
    }
  }
</script>
